<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="renderer" content="webkit">
    <meta name="robots" content="noindex,follow" />
    <title>{$Think.config.CMS_APPNAME}网站管理系统 &rsaquo; 登录</title>
    {load href="__CSS__/bootstrap.min.css"/}
    {load href="__CSS__/elpis.min.css"/}
    {load href="__CSS__/login.css"/}
    {load href="__JS__/jquery-1.10.2.min.js"/}
    {load href="__STATIC__/layer/layer.js"/}
    {load href="__STATIC__/iealert/iealert.min.js"/}
    {load href="__STATIC__/iealert/iealert/style.css"/}
    <script type="text/javascript">
        $(document).ready(function() {
            $("body").iealert({
                support: "ie8",
                title:'你的浏览器太旧了，请升级浏览器！',
                text:'您正在使用IE低版浏览器，为了您的账号安全和更好的产品体验，强烈建议使用更快更安全的浏览器。如果您正在使用360浏览器，请切换到极速模式。',
                upgradeTitle:'升级'
            });
        });
    </script>
</head>
<body class="login" onLoad="reload()">

<div class="wrapper">
    <h1><img src="/public/images/logo.png"></h1>

    <div class="login-body">
        <h2>后台登陆</h2>
        <form name="loginform" id="loginform" action="{:U('Login/doLogin')}" method="post">
            <div class="form-group">
                <input type="text" name="username" id="user_login" class="form-control" placeholder="账号" size="20" />
            </div>
            <div class="form-group">
                <input type="password" name="password" id="user_pass" class="form-control" placeholder="密码" size="20" />
            </div>
            <div class="form-group" style="position: relative">
                <input type="text" name="verifyCode" class="form-control" placeholder="验证码" size="20" style="width:50%" />
                <img src="{:U('Login/verify')}" onclick="this.src='{:U('Login/verify')}'+'&'+Math.random()" class="verifycode" title="{:L('REVERIFY')}" style="position: absolute;top: 0; left: 52%;"/>
            </div>
            <div class="submit">
                <input type="submit" name="submit" class="btn  btn-large" value="登录" />
                <input type="hidden" name="testcookie" value="1" />
            </div>
        </form>

        <div class="forget" style="margin-top: 60px;">
            <a href="{:U('Login/lostpassword')}">
                <span>忘记密码?</span>
            </a>
        </div>
    </div>
</div>
<script type="text/javascript">

function reload(){
    document.loginform.username.focus();
    if(self!=top){
        window.top.location.href = '{:U("Login/index")}';
    }
}

$("#loginform").submit(function () {
    var username, password,verifyCode;

    username = $("input[name='username']").val();
    password = $("input[name='password']").val();
    verifyCode = $("input[name='verifyCode']").val();

    var data = new Object();
    data.username = username;
    data.password = password;
    data.verifyCode = verifyCode;

    var options = new Object();

    options.data = data;
    //options.dataType = 'json';
    options.type = 'post';
    options.success = function(data) {
        if (data.status==1) {
            layer.msg(data.info);
            setTimeout(function(){
                window.location.href = '{:U("Index/index")}';
            },500);
        } else {
            layer.msg(data.info);
        }
    };

    options.url = '{:U('Login/doLogin')}';

    $.ajax(options);
    return false;
});
</script>
</body>
</html>
